package com.dg11185.nearshop.net.request;

import com.dg11185.libs.network.http.client.HttpRequest;
import com.dg11185.libs.utils.MD5.MD5Utils;
import com.dg11185.nearshop.app.Constants;
import com.dg11185.nearshop.net.NetUtils;
import com.dg11185.nearshop.net.response.LoginResponse;

public class LoginRequest extends HttpRequest<LoginResponse> {

    public LoginRequest(String loginName, String loginPwd) {
        super(Constants.ADDRESS, Constants.login);
        addParam("loginName", loginName);
        addParam("loginPwd", loginPwd);
        addParam("version", Constants.version);
        addParam("chshToken", Constants.TOKEN);
        addParam("chshSign", MD5Utils.getMD5Str(getParams(), Constants.MD5_key));
    }

    @Override
    protected LoginResponse parseJson(String response) throws Exception {
        LoginResponse res = new LoginResponse();
        res.parseJson(response);
        return res;
    }

}
